import { BasicColumn, BasicTable, FormSchema, useTable } from "@/components/Table";
import Toolbar from "@/components/ViewComponents/Toolbar";
import { useTranslation } from "react-i18next";

const index = () => {
	const { t } = useTranslation();
	const en_vi = "Hospitalization.attendance";
	const columns: BasicColumn[] = [
		{
			title: t(`${en_vi}.fingerprint`),
			dataIndex: "Fingerprint"
		},
		{
			title: t(`${en_vi}.patientId`),
			dataIndex: "PatientID" //病案号
		},
		{
			title: t(`${en_vi}.admissionNumber`),
			dataIndex: "AdmissionNumber" //入院编号
		},
		{
			title: t(`${en_vi}.fullName`),
			dataIndex: "FullName" //姓名
		},
		{
			title: t(`${en_vi}.gender`),
			dataIndex: "Gender" //性别
		},
		{
			title: t(`${en_vi}.yearOfBirth`),
			dataIndex: "YearOfBirth" //出生年份
		},
		{
			title: t(`${en_vi}.age`),
			dataIndex: "Age" //年龄
		},
		{
			title: t(`${en_vi}.date`),
			dataIndex: "Date" //日期
		},
		{
			title: t(`${en_vi}.transferLocation`),
			dataIndex: "TransferLocation" //转诊地点
		},
		{
			title: t(`${en_vi}.subject`),
			dataIndex: "Subject" //支付类型
		},
		{
			title: t(`${en_vi}.cardNumber`),
			dataIndex: "CardNumber" //卡号
		},
		{
			title: t(`${en_vi}.doctor`),
			dataIndex: "Doctor" //接诊医生
		},
		{
			title: t(`${en_vi}.diagnosis`),
			dataIndex: "Diagnosis" //诊断
		},
		{
			title: t(`${en_vi}.bed`),
			dataIndex: "Bed" //床位
		},
		{
			title: t(`${en_vi}.address`),
			dataIndex: "Address" //地址
		},
		{
			title: t(`${en_vi}.icdCode`),
			dataIndex: "ICDCode" //ICD代码
		},
		{
			title: t(`${en_vi}.receivedFrom`),
			dataIndex: "ReceivedFrom" //来源
		},
		{
			title: t(`${en_vi}.treatmentDate`),
			dataIndex: "TreatmentDate" //治疗日期
		},
		{
			title: t(`${en_vi}.daytime`),
			dataIndex: "Daytime" //白班
		}
	];
	const schemas: FormSchema[] = [
		{
			label: t(`${en_vi}.admissionTime`),
			field: "AdmissionTime", //截至日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.department`),
			field: "Department", //科室
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.profile`),
			field: "Profile", //病历
			component: "Input"
		}
	];
	const [register] = useTable({
		columns,
		useSearchForm: true,
		formConfig: {
			labelWidth: 150,
			schemas,
			showActionButtonGroup: true,
			baseColProps: { span: 7 },
			actionColOptions: { span: 24 }
		},
		bordered: true
	});
	const handlerToolbarAction = (key: string) => {
		console.log(key);
	};
	return (
		<div className="page">
			<div className=" page-content">
				<BasicTable register={register}></BasicTable>
			</div>
			<Toolbar action={handlerToolbarAction} btnList={["save"]} />
		</div>
	);
};
export default index;
